<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>路线规划</title>
</head>
<style>
	html,
	body {
		height: 100%;
		margin: 0px;
		padding: 0px;
		overflow: hidden;
	}

	#mapContainer {
		position: relative;
		width: 100%;
		height: 100%;
	}

	#panel {
		position: absolute;
		background: #FFF;
		width: 300px;
		padding: 10px;
		z-index: 9999;
		top: 20px;
		left: 20px;
		box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
		margin-top: 30px;
	}
	.panelDiv{
		display: flex;
		align-items: center;
	}
	#suggestionList {
		list-style-type: none;
		margin: 0;
		padding: 0;
		max-height: 600px;
		overflow: auto;
	}

	#suggestionList li {
		padding: 10px;
		background-color: #f6f6f6;
	}

	#suggestionList li a {
		margin-top: -1px;
		text-decoration: none;
		font-size: 18px;
		color: #000;
		display: block;
	}

	#suggestionList li span {
		font-size: 12px;
		color: #999;
		display: block;

	}

	#suggestionList li:hover a {
		color: #409eff;
	}

	#suggestionList li:hover span {
		color: #409eff;
	}

	.btn {
		background-color: #fff;
		cursor: pointer;
		border: none;
		border: 1px solid #999;
		width: 80px;
		height: 32px;
		border-radius: 2px;
	}

	.btn:hover {
		background-color: #f4f4f4;
	}

	#keyword {
		height: 25px;
		border: none;
		outline: none;
		flex: 1;
	}

	.infoWindowText {}

	.infoWindowText p {
		margin: 0;
		padding: 0 10px;
		width: auto;
		color: #999;
		font-size: 12px;
	}

	.infoWindowText h4 {
		margin-top: 0;
		margin-bottom: 10px;
	}

	.keywordImg {
		width: 20px;
		height: 20px;
		cursor: pointer;
		margin-left: 5px;
	}
	.logo-text{
		display: none!important;
	}
</style>
<script src="js/mapRoute-min.js"></script>
<script src="js/qwebchannel-min.js"></script>
<body>
	<div id="mapContainer"></div>

	<div id="panel">
		<div class="panelDiv">
			<input id='keyword' type="text" value='' oninput="getSuggestions() " placeholder="请输入地址">
			<!-- <input id="search" type="button" class="btn" value="搜索" onclick="searchByKeyword()" /> -->
			<img class="keywordImg" src="./images/search.png" alt="" onclick="searchByKeyword()">
		</div>
		<ul id="suggestionList">
		</ul>
		<!-- <button onclick="JavaScriptRouteSimulation(60,'drive',pointSet)">驾车路线规划</button>
		<button onclick="JavaScriptRouteSimulation(60,'ride',pointSet)">骑行路线规划</button>
		<button onclick="JavaScriptRouteSimulation(60,'walk',pointSet)">步行路线规划</button>
		<button onclick="JavaScriptRouteSimulation(60,'Transit',pointSet)">公交路线规划</button>
		<button onclick="JavaScriptRouteReset(60,'Transit',pointSet)">重置</button> -->
		<div id="instruction"></div>
	</div>
</body>
<script>
	var pointSet = "W3sibG5nIjoxMTQuMDAxMTkzLCJsYXQiOjIyLjUzNTQzOX0seyJsbmciOjExMy45NTc1MDAsImxhdCI6MjIuNTM1NDM5fSx7ImxuZyI6MTEzLjkwNjYyMCwibGF0IjoyMi41NTQ5MzJ9XQ==";
	function JavaScriptRouteSimulation(interval,type, pointSet) {
		let pointSetString = atob(pointSet);
		if (type == 'drive') {
			DrivingRoute(interval,type, JSON.parse(pointSetString))
		}
		if (type == 'ride') {
			BicyclingRoute(interval,type, JSON.parse(pointSetString))
		}
		if (type == 'walk') {
			WalkingRoute(interval,type, JSON.parse(pointSetString))
		}
		if (type == 'Transit') {
			TransitRoute(interval,type, JSON.parse(pointSetString))
		}
	}
	function JavaScriptRouteReset() {//重置
		mapRouteReset()
	}
	function isPointAvailable(lng, lat) {
		//经度，整数部分为0-180小数部分为0到6位
		var xAvaliable = 1;
		var longreg = /^(\-|\+)?(((\d|[1-9]\d|1[0-7]\d|0{1,3})\.\d{0,6})|(\d|[1-9]\d|1[0-7]\d|0{1,3})|180\.0{0,6}|180)$/;
		if (!longreg.test(lng)) {
			xAvaliable = 0;
		}
		//纬度,整数部分为0-90小数部分为0到6位
		var latreg = /^(\-|\+)?([0-8]?\d{1}\.\d{0,6}|90\.0{0,6}|[0-8]?\d{1}|90)$/;
		if (!latreg.test(lat)) {
			xAvaliable = 0;
		}
		CxxJavaChannelObject.notifyLocationAvailable(lng, lat, xAvaliable);
	}
	//坐标转换完之后的回调函数
	function convertPoint(lng, lat) {
		var geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类
		var location = new TMap.LatLng(lat, lng);
		CxxJavaChannelObject.notifyLocationConvert(lng, lat);
	}

</script>
</html>